import React, {Component} from 'react';
import RouterView from "../../router/RouterView";
import Nav from '../../components/Nav'
import {getNavData} from "../../router/zhoukao2RouterConfig";

class EmsHome extends Component {
  render() {
    window.h = this;

    // console.log(this.props);

    // 怎么拿到的 路由信息
    const {history, match, location} = this.props;
    return (
      <div>

      {/*  <button onClick={()=>{
          //改变浏览器路径
          history.push('/home/ems');
        }}>我要寄件</button>
        <button onClick={()=>{
          //改变浏览器路径
          history.push('/home/ems-info/'+123);



        }}>寄件信息</button>*/}

        {/*
          列表 点击 跳转到动态路由对应的组件中
          [
            {id:10,
            title:'',
            paorps...},,
            {id:9,
            title:'',
            paorps...},
          ]

        */}
        <Nav viewList={getNavData(this.props.routes)}/>


        <RouterView routes={this.props.routes}/>

      </div>
    );
  }
}

export default EmsHome;
